module AutoRest
module DefaultMethods

  module Create
    # POST /resources
    # POST /resources.xml
    def create
      ar_create_resource()

      respond_to do |format|
        if ar_save_resource
          flash[:notice] = ardata.labels[:create_successfull]
          format.html { redirect_to ar_resource_url(@resource) }
          format.xml  { head :created, :location => ar_resource_url(@resource) }
        else
          format.html { render ardata.templates.new   } 
          format.xml  { render :xml => @resource.errors.to_xml }
        end
      end
    end
  end

end
end